package pos.presentation;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Intercambio extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}  	
	
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		processRequest(request, response);
	}   	  	  
	
	public void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		HttpSession session = request.getSession(false);
				
		String desc = request.getParameter("desc");
		session = request.getSession();
		session.setAttribute("desc", desc);
		
		
			
		
		String resource = request.getParameter("res");
		RequestDispatcher d = request.getRequestDispatcher(resource);
		if(d!=null){
			d.forward(request,response);
		}
		
		
	}
	
	public void init() throws ServletException {
	} 
}